<?php

/**
 * 返回当前时间
 * @return false|string
 */
function getDateTime()
{
    return date('Y-m-d H:i:s', time());
}


/**
 * @param $url
 * @param null $data
 * @return mixed
 */
 function http_request($url, $data = null)
{
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    if (!empty($data)) {
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    }
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $info = curl_exec($curl);
    curl_close($curl);
    return $info;
}

/**
 * @param $data
 */
function dd($data)
{
    echo '<pre>';
    print_r($data);
    die;
}

function array_val_chunk($array)
{
    $result = [];
    foreach ($array as $key => $v){
        $result[$v['isbox']][] = $v;
    }
    return $result;
}
